import java.util.Scanner;
public class test521 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Loan Amount: ");
        double loanAmount = scanner.nextDouble();
        System.out.print("Number of Years: ");
        int years = scanner.nextInt();
        System.out.printf("%-15s%-15s%-15s%n", "Interest Rate", "Monthly Payment", "Total Payment");
        for (double rate = 5.0; rate <= 8.0; rate += 0.125) {
            double monthlyRate = rate / 100 / 12;
            int months = years * 12;
            double monthlyPayment = loanAmount * monthlyRate * Math.pow(1 + monthlyRate, months)
                    / (Math.pow(1 + monthlyRate, months) - 1);
            double totalPayment = monthlyPayment * months;
            System.out.printf("%-15.3f%-15.2f%-15.2f%n", rate, monthlyPayment, totalPayment);
        }
        scanner.close();
    }
}

